package magicloan.auctionpocket.adapter;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import magicloan.auctionpocket.R;
import magicloan.auctionpocket.bean.ProduceBean;

/**
 * Created by hechao on 2018/1/31.
 */
public class ThirdFgRightRecylerAdapter extends BaseQuickAdapter<ProduceBean, BaseViewHolder> {

    public ThirdFgRightRecylerAdapter(@LayoutRes int layoutResId, @Nullable List<ProduceBean> data) {
        super(layoutResId, data);
    }

    public ThirdFgRightRecylerAdapter(@Nullable List<ProduceBean> data) {
        super(data);
    }

    public ThirdFgRightRecylerAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    public ThirdFgRightRecylerAdapter(int layoutResId, Context activity) {
        super(layoutResId);
    }

    private TextView mLastTv ;
    @Override
    protected void convert(BaseViewHolder helper, ProduceBean item, int position) {
        final TextView tv_price = helper.getView(R.id.tv_price);
        View root = helper.getView(R.id.root);
        root.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if ( mLastTv != null )
                    mLastTv.setText("¥ 5.9");
                tv_price.setText("Click");
                mLastTv = tv_price ;
            }
        });
    }

}
